<?php
namespace Admin\Controller;
use Think\Page;
use Admin\Model\ShareModel;
use Admin\Model\DiscuzModel;
use Admin\Model\WenkuModel;
class WenkuController extends BaseController{
	
	//分享管理
  public function index(){
		$model=new ShareModel();
		$listRows=1000;												//每页记录数
		$pn=I('get.p') ? I('get.p'):1;								//第几页.无页码是默认第一页
		if ($pn==1) {
			if (file_exists('page.log')) {
				$lastPage=file_get_contents('page.log');
				$pn=$lastPage;
			}
		}
		$data=$model->get_share_doc($pn,$listRows);
		if ($data) {
			file_put_contents('page.log', $pn);
			$next_page=$pn+1;
			$this->success('进入下一页:'.$next_page,U('Wenku/index',array('p'=>$next_page)),rand(3, 5));
		}else{
			file_put_contents('page.log', $pn);
			die('succ');
		}
  }
  
  //分享管理
  public function index1(){
  	$db3=C('DB_CONFIG3');
  	C('DB_CONFIG2',$db3);
  	$Wenku=new WenkuModel();
  	$Wenku->post_doc();
  	die('succ');
  }

  
  
  
}
